package com.test.demo.annotation.proxy.http;

import com.test.demo.annotation.proxy.http.annotation.EnableMyAutoConfiguration;
import com.test.demo.annotation.proxy.http.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@SpringBootApplication
@EnableMyAutoConfiguration(basePackage = "com.test.demo.annotation.proxy.http.service")
public class App {
    public static void main(String[] args) {
        SpringApplication.run(App.class,args);
    }

    @Autowired
    private TestService testService;

    @GetMapping("test")
    public String test(){
        System.out.println(testService.baidu());
        return System.currentTimeMillis()+testService.test1();
    }

    @Bean
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

}
